package cj.web.marriage.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.marriage.domain.MarriageTJ;

/**
 * 
 * @author 
 *
 */
@DAO
public interface MattiageTJDAO{
	
	@SQL("SELECT * FROM MarriageTJ WHERE 1=1 #if(:t.addressId!=-1){ and (addressId =:t.addressId )} #if(:t.manPhone!=''){ and (manPhone like '%##(:t.manPhone)%' )} #if(:t.womanPhone!=''){ and (womanPhone like '%##(:t.womanPhone)%' )} #if(:t.code!=''){ and (code like '%##(:t.code)%' )} ORDER BY createAt DESC LIMIT :t.start,:t.length ")
    List<MarriageTJ> query(@SQLParam("t") MarriageTJ marriageTJ);
	
	@SQL("SELECT count(1) FROM MarriageTJ WHERE 1=1 #if(:t.addressId!=-1){ and (addressId =:t.addressId )} #if(:t.manPhone!=''){ and (manPhone like '%##(:t.manPhone)%' )} #if(:t.womanPhone!=''){ and (womanPhone like '%##(:t.womanPhone)%' )} #if(:t.code!=''){ and (code like '%##(:t.code)%' )} ")
	int querysize(@SQLParam("t") MarriageTJ marriageTJ);
	
	@SQL("SELECT * FROM MarriageTJ WHERE id =:1 ")
	MarriageTJ queryById(int id);
    
}